using UnityEngine;

public class ServeDisplay : MonoBehaviour
{
	public UISprite fillSprite;

	public void Show(float fillAmount)
	{
		base.gameObject.SetActive(true);
		HitParamsDB.TimingRange timingRange = ScriptableObjectSingleton<HitParamsDB>.instance.timing.ranges[0];
		float normTiming = Mathf.Lerp(-1f, 1f, fillAmount);
		foreach (HitParamsDB.TimingRange range in ScriptableObjectSingleton<HitParamsDB>.instance.timing.ranges)
		{
			if (range.isAcceptable(normTiming, 0f))
			{
				timingRange = range;
				break;
			}
		}
		fillSprite.color = timingRange.color;
		fillSprite.fillAmount = fillAmount;
	}

	public void Hide()
	{
		base.gameObject.SetActive(false);
	}
}
